{
 "cells": [
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T15:31:53.029620Z",
     "start_time": "2025-05-05T15:31:53.026621Z"
    }
   },
   "cell_type": "code",
   "source": "",
   "id": "a599206a4fe5df42",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-06T02:02:21.264754Z",
     "start_time": "2025-05-06T02:02:18.864409Z"
    }
   },
   "cell_type": "code",
   "source": [
    "!pip install --no-deps bitsandbytes accelerate xformers==0.0.29.post3 peft trl==0.15.2 triton-windows==3.2.0.post19 cut_cross_entropy unsloth_zoo\n",
    "!pip install sentencepiece protobuf datasets==3.2.0 huggingface_hub hf_transfer\n",
    "!pip install --no-deps unsloth==2025.4.7"
   ],
   "id": "78ce35b89f8e2d9d",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: bitsandbytes in d:\\conda\\v311\\lib\\site-packages (0.45.5)\n",
      "Requirement already satisfied: accelerate in d:\\conda\\v311\\lib\\site-packages (1.6.0)\n",
      "Requirement already satisfied: xformers==0.0.29.post3 in d:\\conda\\v311\\lib\\site-packages (0.0.29.post3)\n",
      "Requirement already satisfied: peft in d:\\conda\\v311\\lib\\site-packages (0.15.2)\n",
      "Requirement already satisfied: trl==0.15.2 in d:\\conda\\v311\\lib\\site-packages (0.15.2)\n",
      "Requirement already satisfied: triton-windows==3.2.0.post19 in d:\\conda\\v311\\lib\\site-packages (3.2.0.post19)\n",
      "Requirement already satisfied: cut_cross_entropy in d:\\conda\\v311\\lib\\site-packages (25.1.1)\n",
      "Requirement already satisfied: unsloth_zoo in d:\\conda\\v311\\lib\\site-packages (2025.4.4)\n",
      "Requirement already satisfied: sentencepiece in d:\\conda\\v311\\lib\\site-packages (0.2.0)\n",
      "Requirement already satisfied: protobuf in d:\\conda\\v311\\lib\\site-packages (3.20.3)\n",
      "Requirement already satisfied: datasets==3.2.0 in d:\\conda\\v311\\lib\\site-packages (3.2.0)\n",
      "Requirement already satisfied: huggingface_hub in d:\\conda\\v311\\lib\\site-packages (0.30.2)\n",
      "Requirement already satisfied: hf_transfer in d:\\conda\\v311\\lib\\site-packages (0.1.9)\n",
      "Requirement already satisfied: filelock in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (3.13.1)\n",
      "Requirement already satisfied: numpy>=1.17 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (1.26.4)\n",
      "Requirement already satisfied: pyarrow>=15.0.0 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (19.0.0)\n",
      "Requirement already satisfied: dill<0.3.9,>=0.3.0 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (0.3.8)\n",
      "Requirement already satisfied: pandas in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (2.2.3)\n",
      "Requirement already satisfied: requests>=2.32.2 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (2.32.3)\n",
      "Requirement already satisfied: tqdm>=4.66.3 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (4.67.1)\n",
      "Requirement already satisfied: xxhash in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (3.5.0)\n",
      "Requirement already satisfied: multiprocess<0.70.17 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (0.70.16)\n",
      "Requirement already satisfied: fsspec<=2024.9.0,>=2023.1.0 in d:\\conda\\v311\\lib\\site-packages (from fsspec[http]<=2024.9.0,>=2023.1.0->datasets==3.2.0) (2024.6.1)\n",
      "Requirement already satisfied: aiohttp in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (3.11.18)\n",
      "Requirement already satisfied: packaging in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (24.2)\n",
      "Requirement already satisfied: pyyaml>=5.1 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (6.0.2)\n",
      "Requirement already satisfied: typing-extensions>=3.7.4.3 in d:\\conda\\v311\\lib\\site-packages (from huggingface_hub) (4.13.2)\n",
      "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (2.6.1)\n",
      "Requirement already satisfied: aiosignal>=1.1.2 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (1.3.2)\n",
      "Requirement already satisfied: attrs>=17.3.0 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (25.3.0)\n",
      "Requirement already satisfied: frozenlist>=1.1.1 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (1.6.0)\n",
      "Requirement already satisfied: multidict<7.0,>=4.5 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (6.4.3)\n",
      "Requirement already satisfied: propcache>=0.2.0 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (0.3.1)\n",
      "Requirement already satisfied: yarl<2.0,>=1.17.0 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (1.20.0)\n",
      "Requirement already satisfied: idna>=2.0 in d:\\conda\\v311\\lib\\site-packages (from yarl<2.0,>=1.17.0->aiohttp->datasets==3.2.0) (3.10)\n",
      "Requirement already satisfied: charset-normalizer<4,>=2 in d:\\conda\\v311\\lib\\site-packages (from requests>=2.32.2->datasets==3.2.0) (3.4.2)\n",
      "Requirement already satisfied: urllib3<3,>=1.21.1 in d:\\conda\\v311\\lib\\site-packages (from requests>=2.32.2->datasets==3.2.0) (2.4.0)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in d:\\conda\\v311\\lib\\site-packages (from requests>=2.32.2->datasets==3.2.0) (2025.4.26)\n",
      "Requirement already satisfied: colorama in d:\\conda\\v311\\lib\\site-packages (from tqdm>=4.66.3->datasets==3.2.0) (0.4.6)\n",
      "Requirement already satisfied: python-dateutil>=2.8.2 in d:\\conda\\v311\\lib\\site-packages (from pandas->datasets==3.2.0) (2.9.0.post0)\n",
      "Requirement already satisfied: pytz>=2020.1 in d:\\conda\\v311\\lib\\site-packages (from pandas->datasets==3.2.0) (2024.1)\n",
      "Requirement already satisfied: tzdata>=2022.7 in d:\\conda\\v311\\lib\\site-packages (from pandas->datasets==3.2.0) (2025.2)\n",
      "Requirement already satisfied: six>=1.5 in d:\\conda\\v311\\lib\\site-packages (from python-dateutil>=2.8.2->pandas->datasets==3.2.0) (1.17.0)\n",
      "Requirement already satisfied: unsloth==2025.4.7 in d:\\conda\\v311\\lib\\site-packages (2025.4.7)\n"
     ]
    }
   ],
   "execution_count": 8
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-06T02:02:29.726656Z",
     "start_time": "2025-05-06T02:02:28.757321Z"
    }
   },
   "cell_type": "code",
   "source": "!pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu126",
   "id": "ce7592d34a4de547",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: https://download.pytorch.org/whl/cu126\n",
      "Requirement already satisfied: torch==2.6.0 in d:\\conda\\v311\\lib\\site-packages (2.6.0+cu126)\n",
      "Requirement already satisfied: torchvision==0.21.0 in d:\\conda\\v311\\lib\\site-packages (0.21.0+cu126)\n",
      "Requirement already satisfied: torchaudio==2.6.0 in d:\\conda\\v311\\lib\\site-packages (2.6.0+cu126)\n",
      "Requirement already satisfied: filelock in d:\\conda\\v311\\lib\\site-packages (from torch==2.6.0) (3.13.1)\n",
      "Requirement already satisfied: typing-extensions>=4.10.0 in d:\\conda\\v311\\lib\\site-packages (from torch==2.6.0) (4.13.2)\n",
      "Requirement already satisfied: networkx in d:\\conda\\v311\\lib\\site-packages (from torch==2.6.0) (3.3)\n",
      "Requirement already satisfied: jinja2 in d:\\conda\\v311\\lib\\site-packages (from torch==2.6.0) (3.1.4)\n",
      "Requirement already satisfied: fsspec in d:\\conda\\v311\\lib\\site-packages (from torch==2.6.0) (2024.6.1)\n",
      "Requirement already satisfied: sympy==1.13.1 in d:\\conda\\v311\\lib\\site-packages (from torch==2.6.0) (1.13.1)\n",
      "Requirement already satisfied: numpy in d:\\conda\\v311\\lib\\site-packages (from torchvision==0.21.0) (1.26.4)\n",
      "Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in d:\\conda\\v311\\lib\\site-packages (from torchvision==0.21.0) (11.0.0)\n",
      "Requirement already satisfied: mpmath<1.4,>=1.1.0 in d:\\conda\\v311\\lib\\site-packages (from sympy==1.13.1->torch==2.6.0) (1.3.0)\n",
      "Requirement already satisfied: MarkupSafe>=2.0 in d:\\conda\\v311\\lib\\site-packages (from jinja2->torch==2.6.0) (2.1.5)\n"
     ]
    }
   ],
   "execution_count": 9
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-06T02:02:32.903903Z",
     "start_time": "2025-05-06T02:02:31.956604Z"
    }
   },
   "cell_type": "code",
   "source": "!pip install modelscope",
   "id": "8a89b56486e7a80d",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: modelscope in d:\\conda\\v311\\lib\\site-packages (1.25.0)\n",
      "Requirement already satisfied: requests>=2.25 in d:\\conda\\v311\\lib\\site-packages (from modelscope) (2.32.3)\n",
      "Requirement already satisfied: tqdm>=4.64.0 in d:\\conda\\v311\\lib\\site-packages (from modelscope) (4.67.1)\n",
      "Requirement already satisfied: urllib3>=1.26 in d:\\conda\\v311\\lib\\site-packages (from modelscope) (2.4.0)\n",
      "Requirement already satisfied: charset-normalizer<4,>=2 in d:\\conda\\v311\\lib\\site-packages (from requests>=2.25->modelscope) (3.4.2)\n",
      "Requirement already satisfied: idna<4,>=2.5 in d:\\conda\\v311\\lib\\site-packages (from requests>=2.25->modelscope) (3.10)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in d:\\conda\\v311\\lib\\site-packages (from requests>=2.25->modelscope) (2025.4.26)\n",
      "Requirement already satisfied: colorama in d:\\conda\\v311\\lib\\site-packages (from tqdm>=4.64.0->modelscope) (0.4.6)\n"
     ]
    }
   ],
   "execution_count": 10
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-06T02:02:38.815349Z",
     "start_time": "2025-05-06T02:02:35.911625Z"
    }
   },
   "cell_type": "code",
   "source": [
    "!pip install addict\n",
    "!pip install datasets==3.2.0\n",
    "!pip install tqdm"
   ],
   "id": "aea6965a260b1ea1",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: addict in d:\\conda\\v311\\lib\\site-packages (2.4.0)\n",
      "Requirement already satisfied: datasets==3.2.0 in d:\\conda\\v311\\lib\\site-packages (3.2.0)\n",
      "Requirement already satisfied: filelock in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (3.13.1)\n",
      "Requirement already satisfied: numpy>=1.17 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (1.26.4)\n",
      "Requirement already satisfied: pyarrow>=15.0.0 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (19.0.0)\n",
      "Requirement already satisfied: dill<0.3.9,>=0.3.0 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (0.3.8)\n",
      "Requirement already satisfied: pandas in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (2.2.3)\n",
      "Requirement already satisfied: requests>=2.32.2 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (2.32.3)\n",
      "Requirement already satisfied: tqdm>=4.66.3 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (4.67.1)\n",
      "Requirement already satisfied: xxhash in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (3.5.0)\n",
      "Requirement already satisfied: multiprocess<0.70.17 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (0.70.16)\n",
      "Requirement already satisfied: fsspec<=2024.9.0,>=2023.1.0 in d:\\conda\\v311\\lib\\site-packages (from fsspec[http]<=2024.9.0,>=2023.1.0->datasets==3.2.0) (2024.6.1)\n",
      "Requirement already satisfied: aiohttp in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (3.11.18)\n",
      "Requirement already satisfied: huggingface-hub>=0.23.0 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (0.30.2)\n",
      "Requirement already satisfied: packaging in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (24.2)\n",
      "Requirement already satisfied: pyyaml>=5.1 in d:\\conda\\v311\\lib\\site-packages (from datasets==3.2.0) (6.0.2)\n",
      "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (2.6.1)\n",
      "Requirement already satisfied: aiosignal>=1.1.2 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (1.3.2)\n",
      "Requirement already satisfied: attrs>=17.3.0 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (25.3.0)\n",
      "Requirement already satisfied: frozenlist>=1.1.1 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (1.6.0)\n",
      "Requirement already satisfied: multidict<7.0,>=4.5 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (6.4.3)\n",
      "Requirement already satisfied: propcache>=0.2.0 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (0.3.1)\n",
      "Requirement already satisfied: yarl<2.0,>=1.17.0 in d:\\conda\\v311\\lib\\site-packages (from aiohttp->datasets==3.2.0) (1.20.0)\n",
      "Requirement already satisfied: idna>=2.0 in d:\\conda\\v311\\lib\\site-packages (from yarl<2.0,>=1.17.0->aiohttp->datasets==3.2.0) (3.10)\n",
      "Requirement already satisfied: typing-extensions>=3.7.4.3 in d:\\conda\\v311\\lib\\site-packages (from huggingface-hub>=0.23.0->datasets==3.2.0) (4.13.2)\n",
      "Requirement already satisfied: charset-normalizer<4,>=2 in d:\\conda\\v311\\lib\\site-packages (from requests>=2.32.2->datasets==3.2.0) (3.4.2)\n",
      "Requirement already satisfied: urllib3<3,>=1.21.1 in d:\\conda\\v311\\lib\\site-packages (from requests>=2.32.2->datasets==3.2.0) (2.4.0)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in d:\\conda\\v311\\lib\\site-packages (from requests>=2.32.2->datasets==3.2.0) (2025.4.26)\n",
      "Requirement already satisfied: colorama in d:\\conda\\v311\\lib\\site-packages (from tqdm>=4.66.3->datasets==3.2.0) (0.4.6)\n",
      "Requirement already satisfied: python-dateutil>=2.8.2 in d:\\conda\\v311\\lib\\site-packages (from pandas->datasets==3.2.0) (2.9.0.post0)\n",
      "Requirement already satisfied: pytz>=2020.1 in d:\\conda\\v311\\lib\\site-packages (from pandas->datasets==3.2.0) (2024.1)\n",
      "Requirement already satisfied: tzdata>=2022.7 in d:\\conda\\v311\\lib\\site-packages (from pandas->datasets==3.2.0) (2025.2)\n",
      "Requirement already satisfied: six>=1.5 in d:\\conda\\v311\\lib\\site-packages (from python-dateutil>=2.8.2->pandas->datasets==3.2.0) (1.17.0)\n",
      "Requirement already satisfied: tqdm in d:\\conda\\v311\\lib\\site-packages (4.67.1)\n",
      "Requirement already satisfied: colorama in d:\\conda\\v311\\lib\\site-packages (from tqdm) (0.4.6)\n"
     ]
    }
   ],
   "execution_count": 11
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-06T02:02:45.722393Z",
     "start_time": "2025-05-06T02:02:45.113518Z"
    }
   },
   "cell_type": "code",
   "source": "!pip check",
   "id": "d06455221bbe7e54",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "No broken requirements found.\n"
     ]
    }
   ],
   "execution_count": 12
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-06T02:02:46.979365Z",
     "start_time": "2025-05-06T02:02:46.505893Z"
    }
   },
   "cell_type": "code",
   "source": "!pip list | findstr /R \"torch transformers peft triton unsloth xformers modelscope datasets\"\n",
   "id": "b6b990f59ae0a2f6",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "datasets                  3.2.0\n",
      "modelscope                1.25.0\n",
      "peft                      0.15.2\n",
      "torch                     2.6.0+cu126\n",
      "torchaudio                2.6.0+cu126\n",
      "torchvision               0.21.0+cu126\n",
      "transformers              4.51.3\n",
      "triton-windows            3.2.0.post19\n",
      "unsloth                   2025.4.7\n",
      "unsloth_zoo               2025.4.4\n",
      "xformers                  0.0.29.post3\n"
     ]
    }
   ],
   "execution_count": 13
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-06T02:01:23.193847Z",
     "start_time": "2025-05-06T02:01:22.716275Z"
    }
   },
   "cell_type": "code",
   "source": "!pip list | findstr /R \"matplotlib pandas pyarrow numpy\"\n",
   "id": "142d049879fad617",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "matplotlib                3.10.0\n",
      "matplotlib-inline         0.1.7\n",
      "numpy                     1.26.4\n",
      "pandas                    2.2.3\n",
      "pyarrow                   19.0.0\n"
     ]
    }
   ],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-06T01:46:17.028267Z",
     "start_time": "2025-05-06T01:45:35.512379Z"
    }
   },
   "cell_type": "code",
   "source": "!conda update matplotlib pandas pyarrow --all\n",
   "id": "28b1d48f32db2d07",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "^C\n"
     ]
    }
   ],
   "execution_count": 3
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": [
    "import torch\n",
    "print(torch.__version__)\n",
    "print(torch.cuda.is_available())"
   ],
   "id": "17aa604e23ba5568"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": [
    "import torch\n",
    "import transformers\n",
    "import modelscope\n",
    "import peft\n",
    "import trl\n",
    "import datasets\n",
    "print(datasets.__version__)\n",
    "print(torch.__version__)\n",
    "print(transformers.__version__)\n",
    "print(modelscope.__version__)\n",
    "print(peft.__version__)\n",
    "print(trl.__version__)\n",
    "print(MsDataset.__version__)"
   ],
   "id": "1e6cead62382177d"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
